-- SERVER SIDE

if (not file.IsDir("TDM/DM","DATA")) then
    file.CreateDir("TDM/DM")
end
if not(file.Exists("TDM/DM/ADM.txt","DATA")) then
	file.Write("TDM/DM/ADM.txt", -1)
	--print("[TDM] Wrote file : TDM/GoalP/GoalP.txt")
	MsgC(Color(255,255,255),"[",Color(255,0,0),"TDM-ADM",Color(255,255,255),"] Wrote file: TDM/DM/ADM.txt\n")
end

function TDMorDM(len, ply)
if !ply:IsSuperAdmin() then 
return end
file.Write("TDM/DM/ADM.txt", math.Round(net.ReadString( )))
	for k,v in pairs(player.GetAll()) do 
	--	umsg.Start("apple_tdm_is_dm", v) -- Sends the message to player
	--		umsg.Short(file.Read("TDM/DM/ADM.txt"))
	--	umsg.End()
	end
timer.Simple(1,function()
	game.ConsoleCommand("changelevel "..tostring(game.GetMap()).."\n")
end)
end
net.Receive("apple_tdm_is_dm", TDMorDM)